#! /bin/bash

set -e

# we run this only for pull-requests, pushes are tested separately
# by copr(tito) webhooks
test "$TRAVIS_PULL_REQUEST" = false && exit 0

# download up2date travis trigger
curl -o copr-build https://raw.githubusercontent.com/praiskup/copr-ci-tooling/master/copr-travis-submit

# trigger the build and watch it
export COPR_PR_WEBHOOK="https://copr.fedorainfracloud.org/webhooks/custom/29795/9d6af83d-7f27-4091-8161-c1098ff5a6dc/$PACKAGE/"

exec bash copr-build
